using System;
using System.Xml;
using System.Collections;

namespace GURUCORE.Portal.Core
{	
	public class RuntimeParameter
	{
		private Hashtable m_htAllParameter = new Hashtable();		

		public string GetParameterValue(string p_sName)
		{
			return m_htAllParameter[p_sName] as string;
		}



        public RuntimeParameter(string p_sParameterString)
        {
            try
            {
                XmlDocument oXml = new XmlDocument();
                oXml.LoadXml(p_sParameterString);

                XmlNode oRootNode = oXml.SelectSingleNode("RuntimeParameter");
                XmlNodeList arrAllParamNode = oRootNode.SelectNodes("Parameter");
                foreach (XmlNode oParamNode in arrAllParamNode)
                {
                    string sName = oParamNode.Attributes["name"].Value.Trim();
                    string sValue = oParamNode.InnerText.Trim();
                    m_htAllParameter.Add(sName, sValue);
                }
            }
            catch
            {
            }
        }
	}
}
